Question: $f(x, y) = \left( \cos(y), -x\sin(y) + \sin(y) + y\cos(y) \right)$ Find $F$ such that $f = \nabla F$. $F(x, y) =$ $ + \, C$
We know that $\nabla F = f$. Therefore: $\begin{aligned} F_x &= \cos(y) \\ \\ F_y &= -x\sin(y) + \sin(y) + y\cos(y) \end{aligned}$ Let's integrate these two equations. Instead of getting a constant at the end of each integral, we'll get a function of the variable with respect to which we didn't integrate. [Example] $\begin{aligned} F &= \int F_x \, dx \\ \\ &= \int \cos(y) \, dx \\ \\ &= x\cos(y) + H(y) \end{aligned}$ For the integral of $F_y \, dy$, we'll need to use integration by parts. The simplest way is to set $u = y$ and $dv = \cos(y) \, dy$. $\begin{aligned} F &= \int F_y \, dy \\ \\ &= \int -x\sin(y) + \sin(y) + y\cos(y) \, dy \\ \\ &= x\cos(y) - \cos(y) + \left( y\sin(y) - \int \sin(y) \, dy \right) \\ \\ &= x\cos(y) + y\sin(y) + G(x) \end{aligned}$ Now we can set both ways of writing $F$ equal to find $G$ and $H$. $x\cos(y) + H(y) = x\cos(y) + y\sin(y) + G(x)$ Therefore: $\begin{aligned} G(x) &= C_1 \\ \\ H(y) &= y\sin(y) + C_2 \end{aligned}$ We can write $C_1$ and $C_2$ as a single arbitrary constant $C$ in the final version of $F$. Putting everything together: $F(x, y) = x\cos(y) + y\sin(y) + C$